
import {Component} from 'react';
import Three from './three';
import {Context} from './parent'



class Two extends Component{
   
    render(){
        return(
            <div>
                <h2>组件2</h2>
                    <Context.Consumer>
                       {
                        (value)=>{
                              //console.log(value,"组件2===>>");
                          return <div>
                               <p>{value.msg}</p>
                               <p>{value.num}</p>
                               </div> 
                        }   
                       }
                    </Context.Consumer>
                <Three></Three>
            </div>
        )
    }
}
export default Two